#ifndef USER_INFO_MANAGEMENT_H
#define USER_INFO_MANAGEMENT_H

#include <string>

#include <mysql/mysql.h>
#include "../ConnectMsg.h"

class UserInfoManagement
{
public:
    UserInfoManagement(const std::string& dbName,
		       const std::string& ip = "127.0.0.1",
		       const unsigned int& port = 3306,
		       const std::string& usr = "root",
		       const std::string& pwd = "");
    ~UserInfoManagement();

    QueryResult LoginVerify(const std::string& usr,
			    const std::string& pwd);
    QueryResult Register(const std::string& usr,
			 const std::string& pwd);
private:
    void Release();

    MYSQL m_mysql;
    MYSQL_RES* m_res;
    MYSQL_ROW m_row;
};

#endif
